//
//  chatDataSource.h
//  tcpoctest
//
//  Created by gump on 6/19/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

@interface chatDataSource : NSObject
{
    NSMutableDictionary     *chatDic;//人的聊天消息源
    
    pthread_mutex_t         mutexChat;
    
    NSMutableDictionary     *chatSequenceDic;//每条消息的序列号（客户端生成）
    NSMutableDictionary     *chatIDDic;//每条消息的id（服务器生成）
    
    NSMutableArray          *ModifyStateArr;//阅读状态改变数组
    int                     iModifyState;//要改变为的状态
}

@property(nonatomic,strong) NSMutableArray      *currentChatArr;
@property(nonatomic,strong) NSString            *strSendChatContent;
@property(nonatomic,strong) ChatContentInfo     *reSendInfo;//重发消息

-(void)SetSendChatContent:(NSString *)str;
-(NSString *)SendChatContent;

-(void)RemoveAllChatDic;
-(void)SetChatDicArr:(NSMutableArray *)chatarr withKey:(NSString *)strkey;
-(NSMutableArray *)GetArrByKey:(NSString *)strkey;
-(void)RemoveObjectByKey:(NSString *)strkey;

-(void)DelCurChatArrObjectByRow:(int)irow;

-(ChatContentInfo *)getLastChatInfoByMail:(NSString *)strmail;//传用户的帐号
-(ChatContentInfo *)getChatInfoBySequence:(int)is;//通过序列
-(ChatContentInfo *)getChatInfoByID:(NSString *)strid;//传消息的id

-(void)addChatInfo:(ChatContentInfo *)ccinfo withSquence:(int)is;
-(void)addChatInfo:(ChatContentInfo *)ccinfo withID:(NSString *)strid;

-(void)addModifyStateArr:(ChatContentInfo *)ccinfo;//添加聊天信息的状态
-(void)ProcessModifyState;//处理改变状态
-(void)SetModifyState:(int)istate;//设置最后的状态值

@end
